#include "solver.h"

static double memory = 0;
void *my_malloc(int n, int size)
{
    void *p = calloc(n, size);
    if (!p)
        ABORT("malloc fail");
    memory += n * size;
    return p;
}

void my_free(void *p, int n, int size)
{
    if (!p)
        return;
    memory -= n * size;
    free(p);
}

double get_memory()
{
    return memory;
}
